package com.ext.demo21.service;

import com.ext.demo21.entity.User;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

@Service
public class TestService {

    @Cacheable(value = "user",key = "#id")
    public User  getUser(int id){
        User user = new User();
        user.setId(id);
        user.setName("name");
        return  user;
    }
}
